#coding=utf-8

from former_project.common_logic.utility.singleton import Singleton

class TestNormal:
    
    A_VARIABLE = 'aa'
    
    def run(self):
        print 'run'
        print self.A_VARIABLE
        self.A_VARIABLE = 'bb'
        
class TestSingleton(Singleton):
    '''单实例应用测试'''
    A_VARIABLE = 'aa'
    
    def run(self):
        print 'run'
        print self.A_VARIABLE
        self.A_VARIABLE = 'bb'

    
if __name__ == "__main__":
    test1 = TestNormal()
    test1.run()
    test2 = TestNormal()
    test2.run()
    test3 = TestNormal()
    test3.run()
    print '%%%%%%%%%%%%%%%%%%%%%'
    test1 = TestSingleton.get_instance()
    test1.run()
    test2 = TestSingleton.get_instance()
    test2.run()
    test3 = TestSingleton.get_instance()
    test3.run()
    
    